<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>#{$sys.title}#</title>
    <meta name="keywords" content="零起飞CRM,免费CRM,客户管理系统,客户管理软件,客户关系管理软件,客户关系管理系统,CRM软件,CRM系统">
    <meta name="description"
          content="零起飞客户关系管理系统(07FLY-CRM）针对企业不同阶段提供不同的客户管理CRM系统功能，以实现企业对客户管理的需要，网络中只需一台电脑安装本客户管理CRM系统，其它电脑均可通过浏览器使用。">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html"/>
    <![endif]-->
    <link rel="shortcut icon" href="favicon.ico">
    <link href="#{$smarty.const.APP}#/View/template/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="#{$smarty.const.APP}#/View/template/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="#{$smarty.const.APP}#/View/template/css/animate.css" rel="stylesheet">
    <link href="#{$smarty.const.APP}#/View/template/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="#{$smarty.const.APP}#/View/template/css/plugins/toastr/toastr.min.css" rel="stylesheet">
</head>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
<div id="wrapper">
    <!--左侧导航开始-->
    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="nav-close"><i class="fa fa-times-circle"></i></div>
        <div class="sidebar-collapse">
            <ul class="nav" id="side-menu">
                <li class="nav-header">
                    <div class="dropdown profile-element"><a data-toggle="dropdown" class="dropdown-toggle"
                                                             href="#{$smarty.const.ACT}#/sysmanage/Index/index/"> <span
                            class="clear"> <span class="block m-t-xs" style="font-size:20px;"> <img
                            src="#{$smarty.const.APP}#/View/template/img/logo.png" width="30" height="30"> <img
                            src="#{$smarty.const.APP}#/View/template/img/logo1.png" height="31"> </span> </span> </a>
                        <ul class="dropdown-menu animated fadeInRight">
                            <!-- <li><a class="J_menuItem" href="form_avatar.html">修改头像</a> </li>-->
                            <li><a class="J_menuItem" href="#{$smarty.const.ACT}#/sysmanage/Index/index/">管理中心</a></li>
                            <!--<li><a class="J_menuItem" href="mailbox.html">信箱</a> </li>-->
                            <li class="divider"></li>
                            <li><a href="#{$smarty.const.ACT}#/sysmanage/Login/logout/">安全退出</a></li>
                        </ul>
                    </div>
                    <div class="logo-element"><img src="#{$smarty.const.APP}#/View/template/img/logo.png" width="30"
                                                   height="30"></div>
                </li>
                <li class="line dk"></li>
                #{foreach from=$menu key=k item=v1}#<!--显示主模块-->
                <li><a href="javascript:void(0)"><i class="fa fa-#{$v1.url}#"></i> <span
                        class="nav-label">#{$v1.name}# </span><span class="fa arrow"></span></a>
                    <ul class="nav nav-second-level">
                        #{foreach from=$v1.parentID key=k item=v2}#
                        #{if $v2.parentID neq null }#
                        <li><a class="J_menuItem" href="javascript:void(0)">#{$v2.name}#<span
                                class="fa arrow"></span></a>
                            <ul class="nav nav-third-level">
                                #{foreach from=$v2.parentID key=k item=v3}#
                                <li><a class="J_menuItem" href="#{$smarty.const.ACT}##{$v3.url}#">#{$v3.name}#</a></li>
                                #{/foreach}#
                            </ul>
                        </li>
                        #{else}#
                        <li><a class="J_menuItem" href="#{$smarty.const.ACT}##{$v2.url}#">#{$v2.name}#</a> #{/if}#
                            #{/foreach}#
                    </ul>
                </li>
                #{/foreach}#
                <li class="line dk"></li>
                <li>
                    <a href="#"><i class="fa fa-cogs"></i> <span class="nav-label">技术支持</span><span
                            class="fa arrow"></span></a>
                    <ul class="nav nav-second-level">
                      <li><a href="http://www.07FLY.top" target="_blank">官网：07FLY.TOP</a></li>
                      <li><a href="tel:18030402705">手机：18030402705</a></li>
                        <li><a href="http://wpa.qq.com/msgrd?v=3&amp;uin=1871720801&amp;site=qq&amp;menu=yes"
                               target="_blank">Q Q：1871720801</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>
    <!--左侧导航结束-->
    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row border-bottom">
            <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                <div class="navbar-header"><a class="navbar-minimalize minimalize-styl-2 btn btn-info " href="#"><i
                        class="fa fa-bars"></i> </a>
                </div>
                <div class="navbar-module">
                    <a href="http://oa.07fly.com/" target="_blank" title="07FLY-CRM开源系统V1版本">V1版本</a>
                    <a href="http://erp.07fly.com/" target="_blank" title="07FLY-CRM开源系统V2版本">V2版本</a>
                    <a href="http://erp.07fly.xyz/" target="_blank" title="07FLY-ERP企业管理系统">S1版本</a>
                    <a href="http://djt.07fly.xyz/" target="_blank" title="旅行社ERP管理软件地接版">地接通</a>
                </div>
                <ul class="nav navbar-top-links navbar-right">
                   <li><a href="http://www.07fly.xyz/"><i class="fa fa-home"></i>官网</a></li>
                   <li><a href="http://www.07fly.xyz/index/lists/index/tid/35.html"><i class="fa fa-shopping-cart"></i>授权</a></li>
                    <li class="dropdown"><a class="dropdown-toggle count-info" data-toggle="dropdown" href="#"> <i
                            class="fa fa-chevron-down"></i>#{$sys_account}#</a>
                        <ul class="dropdown-menu dropdown-alerts">
                            <li><a class="J_menuItem" href="#{$smarty.const.ACT}#/sysmanage/Sys/sys_password_modify/">
                                <div>修改密码</div>
                            </a></li>
                            <li class="divider"></li>
                          <li><a class="dropdown-toggle count-info" href="#{$smarty.const.ACT}#/sysmanage/Login/logout/"> <i class="fa fa-sign-out"></i>登出</a></li>
                        </ul>
                    </li>
                </ul>
            </nav>
        </div>
        <div class="row J_mainContent" id="content-main">
            <iframe name="J_iframe" id="J_iframe" width="100%" height="100%" src="" frameborder="0" data-id="#{$smarty.const.ACT}#/sysmanage/Index/index/" seamless></iframe>
        </div>
    </div>
    <!--右侧部分结束-->
</div>

<!-- 全局js -->
<script src="#{$smarty.const.APP}#/View/template/js/jquery.min.js?v=2.1.4"></script>
<script src="#{$smarty.const.APP}#/View/template/js/jquery.cookie.js"></script>
<script src="#{$smarty.const.APP}#/View/template/js/bootstrap.min.js?v=3.3.6"></script>
<script src="#{$smarty.const.APP}#/View/template/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="#{$smarty.const.APP}#/View/template/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="#{$smarty.const.APP}#/View/template/js/plugins/layer/layer.min.js"></script>
<!-- 自定义js -->
<script src="#{$smarty.const.APP}#/View/template/js/hAdmin.js?v=4.1.0"></script>
<script type="text/javascript" src="#{$smarty.const.APP}#/View/template/js/index.js"></script>
<!-- 第三方插件 -->
<script src="#{$smarty.const.APP}#/View/template/js/plugins/pace/pace.min.js"></script>
<!-- Toastr script -->
<script src="#{$smarty.const.APP}#/View/template/js/plugins/toastr/toastr.min.js"></script>
<script>
    $(document).ready(function () {
        var iframeUrl = localStorage.getItem('iframeUrl');
        if (typeof (iframeUrl) != "undefined" && iframeUrl !=null) {

        }else{
            iframeUrl='#{$smarty.const.ACT}#/sysmanage/Index/index/';
        }
        document.onkeypress = function (e) {
            if (e.keyCode == 116) {
                e.preventDefault(); //组织默认刷新
                iframe.src = iframeUrl;
            }
        }

        //刷新时设置当前点击页面数据
        if (typeof (iframeUrl) != "undefined") {
            that=$("a[href='"+iframeUrl+"']");
            //that.parent('li').addClass('active');
            that.parents('ul.nav').addClass('in');
            that.parents('ul.nav').parent('li').addClass('active');
            $('#J_iframe').attr('src', iframeUrl);//重新设置获取的url，实现刷新显示当前页面
        }

        //保存点击
        $(".J_menuItem").on('click', function () {
            var  itemUrl = $(this).attr('href');
            console.log(iframeUrl);
            localStorage.setItem('iframeUrl',itemUrl);
        });

    });


    //声音播放插件
    var playSound = function () {
        var borswer = window.navigator.userAgent.toLowerCase();
        if (borswer.indexOf("ie") >= 0) {
            //IE内核浏览器
            var strEmbed = '<embed name="embedPlay" src="/upload/video.wav" autostart="true" hidden="true" loop="false"></embed>';
            if ($("body").find("embed").length <= 0)
                $("body").append(strEmbed);
            var embed = document.embedPlay;

            //浏览器不支持 audion，则使用 embed 播放
            embed.volume = 100;
            //embed.play();这个不需要
        } else {
            //非IE内核浏览器
            var strAudio = "<audio id='audioPlay' src='/upload/video.wav' hidden='true'>";

            if ($("#audioPlay").length <= 0) {
                $("body").append(strAudio);
            }
            var audio = document.getElementById("audioPlay");
            //浏览器支持 audio
            audio.play();
        }
    }

    //调用计划任务执行程序
    var cron_notice = function () {
        $.ajax({
            type: 'POST',
            url: '#{$smarty.const.ACT}#/sysmanage/Notice/notice_cron_json/',
            data: {"status": "-1"},
            dataType: 'json',
            success: function (data) {
                $(data.list).each(function (index, item) {
                    //index指下标
                    //item指代对应元素内容
                    //this指代每一个元素对象
                    playNotice(item.id, item.title, item.content);
                    //console.log(item);
                    //console.log($(this));
                });
                // console.log(JSON.stringify(data));
            }
        });
    }
    //提示通知插件
    var playNotice = function (id, title, content) {
        toastr.options = {
            "closeButton": true,
            "debug": false,
            "progressBar": true,
            "onclick": null,
            "positionClass": "toast-bottom-right",
            "showDuration": "400",
            "hideDuration": "1000",
            "timeOut": "10000",
            "extendedTimeOut": "1000",
            "showEasing": "swing",
            "hideEasing": "linear",
            "showMethod": "fadeIn",
            "hideMethod": "fadeOut"
        }
        toastr.options.onclick = function () {
            layer.open({
                type: 2,
                title: '查看通知',
                shadeClose: true,
                fixed: false, //不固定
                area: ['90%', '90%'],
                content: '#{$smarty.const.ACT}#/sysmanage/Notice/notice_view/notice_id/' + id + '/'
            });
        };
        toastr.info(content, title);
    }
    //提示通知插件
    var playMessage = function () {
        $.ajax({
            type: 'POST',
            url: '#{$smarty.const.ACT}#/sysmanage/Message/message_cron_json/',
            data: {"status": "-1"},
            dataType: 'json',
            success: function (data) {
                if (data.list.length > 0) {
                    parent.layer.open({
                        type: 2,
                        title: '',
                        closeBtn: 1,
                        shade: 0,
                        area: ['350px', '250px'],
                        offset: 'rb', //右下角弹出
                        time: 30000, //2秒后自动关闭
                        shift: 2,
                        anim: 4,
                        content: ['#{$smarty.const.ACT}#/sysmanage/Message/message_show_cron/', 'no'], //iframe的url，no代表不显示滚动条
                        end: function () {
                        }
                    });
                    playSound();
                }
            }
        });
    }
    //主动调用
    //setInterval("func()", 60000);
    setInterval("cron_notice()", 20000);
    setInterval("playMessage()", 600000);
    cron_notice();
    playMessage();
</script>
</body>
</html>
